import { get, post, put, del, upload } from '@/utils/request'
import { param } from 'jquery'

const VERSION = 'v1'

export default {
    //终端树数据
    // 加载树
    // loadTree: params => get(VERSION, '/terminal/group/list', params),
    loadTree: params => get(VERSION, '/terminal/common/group/list', params),
    // 新增树节点
    addTreeNode: params => post(VERSION, '/terminal/group', params),
    // 编辑树节点
    editTreeNode: params => put(VERSION, '/terminal/group', params),
    // 删除终端
    deleteTreeNode: params => del(VERSION, '/terminal/group', params),
    // 终端列表
    deviceList: params => get(VERSION, '/terminal/page', params),
    // 终端点击列表
    terminalClickList: params => get(VERSION, '/terminal/queryTerminalClick', params),
    //  统计汇总 新闻点击统计
    newsClickStatistics: params => get(VERSION, '/terminal/statisticsClick', params),
    //  图表统计汇总 新闻点击统计
    clickStatisticsData: params => get(VERSION, '/terminal/getClickStatisticsData', params),

    deviceListByGroup: params => get(VERSION, '/terminal/common/terminal/list', params),
    // 删除终端信息
    deleteDeviceInfo: params => del(VERSION, '/terminal', params),
    //终端标签数数据
    // 加载树
    loadTagTree: params => get(VERSION, '/terminal/common/tree', params),
    // 终端分组标签主键查询
    getTagListBy: params => get(VERSION, '/terminal/group/tag', params),
    // 保存标签
    saveTag: params => post(VERSION, '/terminal/group/tag', params),


    // 添加终端信息
    addDeviceInfo: params => post(VERSION, '/terminal', params),
    // 修改终端信息
    updateDeviceInfo: params => put(VERSION, '/terminal', params),
    // 批量修改终端信息
    setDeviceInfo: params => put(VERSION, '/terminal/batch', params),
    // 根据ID获取终端信息
    getDeviceBy: params => get(VERSION, '/terminal', params),
    // 终端审核
    deviceExamine: params => put(VERSION, '/terminal/audit', params),

    // 导入车辆信息
    importCarInfo:  (params, progressCb, cancelToken) => upload(VERSION, '/terminal/import',  params, progressCb, cancelToken),
    // 查询导入的车辆信息
    loadCarInfo:  params => get(VERSION, '/terminal/excel_page', params),
    //分组调整导入车辆信息确认
    updateGroupTemp:  params => post(VERSION, '/terminal/updateGroupbyPage', params),
    //分组导入确认
    updateGroupConfirm:  params => post(VERSION, '/terminal/updateGroup', params),
    // 终端监控列表
    deviceMonitorList: params => get(VERSION, '/terminal/status/page', params),
    // 获取终端监控详情
    getDeviceMonitorBy: params => get(VERSION, '/terminal/status', params),

    // 查询播放监控列表
    loadPlayList: params => get(VERSION, '/terminal/status/play', params),
    // 查询命令监控列表
    loadCommandList: params => get(VERSION, '/terminal/status/command/page', params),
    // 终端日志
    loadDeviceLogList: params => get(VERSION, '/terminal/status/logs/page', params),

    
    // 查询预警规则列表
    warnRuleList: params => get(VERSION, '/terminal/warnrule/list', params),
    // 新增预警规则
    addWarnRule: params => post(VERSION, '/terminal/warnrule', params),
    // 编辑预警规则
    editWarnRule: params => put(VERSION, '/terminal/warnrule', params),
    // 删除预警规则
    deleteWarnRule: params => del(VERSION, '/terminal/warnrule', params),
    // 查询有预警的终端列表
    warnTerminalList: params => get(VERSION, '/terminal/warnrule/terminalwarn', params),
    // 查询单个有预警的终端的详细信息
    getWarnTerminalStatus: params => get(VERSION, '/terminal/warnrule/terminalstatus', params),


    // 终端指令
    // 屏幕截图
    commandPrintScreen: params => post(VERSION, '/terminal/status/printscreen', params),
    // 屏幕监控的截屏
    commandScreen: params => post(VERSION, '/screen/monitor/printscreen', params),
    // 开关机指令 power	指令(0:待机 1:开机 2:重启)
    commandSwitch: params => post(VERSION, '/terminal/command/switch', params),
    // 电子围栏待机 online 在线状态(0:离线 1:在线 2:待机)
    commandMapSwitch: params => post(VERSION, '/terminal/command/idle', params),
    // 清理播出文件
    commandClearFile: params => post(VERSION, '/terminal/status/clear/file', params),
    // 网络校时
    commandClock: params => post(VERSION, '/terminal/command/clock', params),
    // 上传播放日志文件
    commandUploadPlayLog: params => post(VERSION, '/terminal/command/upload/playlog', params),
    // 上传系统日志文件
    commandUploadSysLog: params => post(VERSION, '/terminal/command/upload/syslog', params),
    // 插播广告
    commandPlayAd: params => post(VERSION, '/terminal/command/play/file', params),
    // 获取终端文件列表
    commandFileList: params => post(VERSION, '/terminal/command/filelist', params),
    // 一键切换dtmb
    commandOparetinDTMB:  params => post(VERSION, '/terminal/command/switch/dtmb', params),

    // 终端升级
    // 查询终端可升级的文件
    terminalFilelist: params => get(VERSION, '/terminal/upgradefile/list', params),
    // 上传文件
    uploadFile: params => upload(VERSION, '/terminal/upgradefile', params),
    // uploadFile: params => post(VERSION, '/terminal/upgradefile', params),
    // 删除文件
    deleteFile: params => del(VERSION, '/terminal/upgradefile', params),
    // 升级
    commandUpgrade: params => post(VERSION, '/terminal/upgradefile/batch', params),

    // 驾驶舱终端与屏幕
    terminalCockpitInfo: params => get(VERSION, '/cockpit/count', params),
    // 驾驶舱终端与屏幕 - 车辆统计详情
    terminalCockpitCarInfo: params => get(VERSION, '/cockpit/car_count', params),
    //  驾驶舱 车辆运营走势
    vehicleOperationCount: params => get(VERSION, '/cockpit/vehicle_operation_count', params),

}

